<script setup lang="ts">
import { useUserStore } from "./stores/modules/user";
import { Button } from 'vant';
import { ref } from "vue";
import { request } from "./utils/request";
import { User } from "./types/User";
const store = useUserStore()
const doClick = async () => {
  request<User>('login/password', 'post', {
    mobile: '13230000001',
    password: 'abc12345'
  }).then(res => {
    console.log(res);
    store.setUser(res.data)
  })
}
const doText = () => {
  request('patient/myUser', 'get').then(res => {
    console.log(res.data);

  })
}
</script>

<template>
  <h1>组件</h1>
  <Button type="danger">123</Button>
  <Button type="primary" @click="doClick">登录</Button>
  <Button @click="doText">测试</Button>
  <div class="box">123123</div>
</template>

<style scoped lang="scss">
.box {
  width: 100px;
  height: 100px;
  background-color: var(--cp-primary);
}
</style>
